package com.zlf.sb.demo.design.ali.templete;

import com.zlf.sb.demo.result.BaseResult;

import java.util.List;

/***
 *@title AbstractDataCheckProductService
 *@description <TODO description class purpose>
 *@author wgc_j
 *@version 1.0.0
 *@create 2025-02-13 14:29
 **/
public abstract class AbstractDataCheckProductService implements DataCheckProductService {
    @Override
    public <T> BaseResult dataCheck(DataCheckRequestDTO request) {
        try {
           // 1. 参数合法性检查
            //runDataCheck();
            // 2. 创建导出任务
            ////3. 进行数据检查
            // 4. 写入文件
            //5. 更新任务为完成状态
            return BaseResult.ofSuccess(1L);
        } catch (Exception e) {
            return BaseResult.ofFail(e.getMessage());
        }
    }

    /**
     * 进行数据校验
     * @param dataList 存放检查结果
     * @param request 请求参数
     * @param <T>
     */
    public abstract <T> void runDataCheck(List<T> dataList, DataCheckRequestDTO request);
}
